<template>
  <el-container>
    <el-aside width="200px">
      <el-menu
        default-active="1"
        class="el-menu-vertical-demo"
        @open="handleOpen"
        @close="handleClose"
        unique-opened="true"
        router="true"
      >
      <img class="logo" src="@/assets/logo.png">
      <el-menu-item index="1">
        <el-icon><Odomete /></el-icon>
            <span>仪表盘</span>
      </el-menu-item>
        <el-sub-menu index="2">
          <template #title>
            <el-icon><Grid /></el-icon>
            <span>常用设置</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="/Teacher">教师管理</el-menu-item>
            <el-menu-item index="2-2">学生管理</el-menu-item>
            <el-menu-item index="2-3">公告管理</el-menu-item>
            <el-menu-item index="2-4">系统配置</el-menu-item>
            <el-menu-item index="2-5">判题服务器</el-menu-item>
          </el-menu-item-group>
        </el-sub-menu>
        <el-sub-menu index="3">
          <template #title>
            <el-icon><Aim /></el-icon>
            <span>问题</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="3-1">问题列表</el-menu-item>
            <el-menu-item index="3-2">增加题目</el-menu-item>
            <el-menu-item index="3-1">导入导出题目</el-menu-item>
          </el-menu-item-group>
        </el-sub-menu>
        <el-sub-menu index="4">
          <template #title>
            <el-icon><Trophy /></el-icon>
            <span>比赛</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="4-1">比赛列表</el-menu-item>
            <el-menu-item index="4-2">创建比赛</el-menu-item>
          </el-menu-item-group>
        </el-sub-menu>
        <el-sub-menu index="5">
          <template #title>
            <el-icon><Odometer /></el-icon>
            <span>课程</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="/Course">课程列表</el-menu-item>
            <el-menu-item index="5-2">创建课程</el-menu-item>
          </el-menu-item-group>
        </el-sub-menu>
      </el-menu>
    </el-aside>
    <el-container>
      <el-header>
        <el-icon class="iconclass"><Search /></el-icon>
        <el-icon class="iconclass"><Share /></el-icon>
        <el-dropdown>
          <span class="el-dropdown-link">
            sername
            <el-icon class="el-icon--right">
              <arrow-down />
            </el-icon>
          </span>
          <template #dropdown>
            <el-dropdown-menu>
              <el-dropdown-item>logout</el-dropdown-item>
            </el-dropdown-menu>
          </template>
        </el-dropdown>
      </el-header>
      <el-main>
        <router-view></router-view>
      </el-main>
      <el-footer>BuildVersion:20220505</el-footer>
    </el-container>
  </el-container>
</template>

<script>
import {Odometer,Grid,Aim,Trophy,Search,Share,ArrowDown} from "@element-plus/icons-vue" 
export default {
  name: 'App',
  components: {
    Odometer,
    Grid,
    Aim,
    Trophy,
    Search,
    Share,
    ArrowDown
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
.logo{
  width: 100px;
  margin: 40px 0;
}
.el-header{
  background-color: #f9fafc;
  text-align: right;
  font-weight: bold;
  --el-header-height:50px;
  line-height: 50px;
}
.el-dropdown{
  line-height: 45px;
}
.iconclass{
  margin: 0 5px;
}
.el-main,el-footer{
  background-color: #edecec;
}
</style>
